﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LinqToLfsWorld
{
	/// <summary>
	/// An exception which is thrown if there is a problem gaining a response from LfsWorld.
	/// </summary>
	public class PubstatRequestException : Exception
	{

		/// <summary>
		/// Gets the request URL.
		/// </summary>
		/// <value>The request URL.</value>
		public string RequestUrl { get; private set; }

		/// <summary>
		/// Gets the response.
		/// </summary>
		/// <value>The response.</value>
		public string Response { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="PubstatRequestException"/> class.
		/// </summary>
		/// <param name="requestUrl">The request URL.</param>
		/// <param name="response">The response.</param>
		public PubstatRequestException(string requestUrl, string response)
			: base("Could not complete the request to the Lfs Pubstat server")
		{
			RequestUrl = requestUrl;
			Response = response;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="PubstatRequestException"/> class.
		/// </summary>
		/// <param name="requestUrl">The request URL.</param>
		/// <param name="response">The response.</param>
		/// <param name="message">The message.</param>
		public PubstatRequestException(string requestUrl, string response, string message)
			: base(message)
		{
			RequestUrl = requestUrl;
			Response = response;
		}

	}
}
